package dataStructure.linkedList.Recurrence;

/**
 * @Description: 求一个数的阶乘
 * @Date: 2020/4/8
 * @Author: 许群星
 */
public class Factorial {
    public static void main(String[] args) {
        int a=5;
        System.out.println(factorial(a));
    }
    public static int factorial(int a){
        if (a==0||a==1)
            return 1;
        else
            return a*factorial(a-1);
    }
}
